package logic

import (
	"cart/cache"
	"context"

	"cart/cart"
	"cart/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartDelLogic {
	return &CartDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartDelLogic) CartDel(in *cart.CartDelRequest) (*cart.CartDelResponse, error) {
	// todo: 删除购物车
	cache.CartDel(int(in.UserId), int(in.GoodsId))
	return &cart.CartDelResponse{}, nil
}
